home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
p4
/
p4-1_2c.lha
/
p4-1.2c
/
usc
/
usc.h
< prev
Wrap
C/C++ Source or Header
|
1993-05-24
|
3KB
|
170 lines
/*
* USC.H (Public header file for the Microsecond Clock package)
* This header file has to be included by an application using
* the USC function calls.
*
* Written by: Arun Nanda (07/17/91)
* Modified by R. Butler
*
* The following machine-specific libraries need to be linked in
* with the application using the UST functions:
*
*/
#ifndef _USC_DEFS_ /* takes care of multiple inclusion of this file */
#define _USC_DEFS_
#ifdef SUN_IPC
#define SUN
#endif
#ifdef CONVEX
#define SUN
#endif
#ifdef DEC5000_IPC
#define DEC5000
#endif
#ifdef HP_IPC
#define HP
#endif
#ifdef SP1
#define RS6000
#endif
#ifdef RS6000_IPC
#define RS6000
#endif
#ifdef IBM3090_IPC
#define IBM3090
#endif
#ifdef TITAN_IPC
#define TITAN
#endif
#ifdef SGI_IPC
#define SGI
#endif
#ifdef DELTA
#define IPSC860
#endif
#ifdef PARAGON
#define IPSC860
#endif
/* ---------------------
Global declarations
--------------------- */
typedef unsigned long usc_time_t;
#ifndef VOID
# if defined(BALANCE) || defined(FX8)
# define VOID int
# else
# define VOID void
# endif
#endif
/* --------------------------------
Machine dependent declarations
-------------------------------- */
#if defined(MULTIMAX)
extern unsigned *usc_multimax_timer;
#endif
#if defined(SYMMETRY) || defined(SYMMETRY_PTX)
#ifndef GETUSCLK
# include <usclkc.h>
#endif
#endif
extern usc_time_t usc_MD_rollover_val;
/* -----------------------
user interface macros
----------------------- */
#if defined(MULTIMAX)
# define usc_clock() ((usc_time_t) *usc_multimax_timer)
# define usc_rollover_val() (usc_MD_rollover_val)
#else
#if defined(SYMMETRY) || defined(SYMMETRY_PTX)
# define usc_clock() ((usc_time_t) getusclk())
# define usc_rollover_val() (usc_MD_rollover_val)
#else
#if defined(TC_2000) || defined(TC_2000_TCMP)
# define usc_clock() usc_MD_clock()
# define usc_rollover_val() (usc_MD_rollover_val)
#else
#if defined (NCUBE)
# define usc_clock() usc_MD_clock()
# define usc_rollover_val() (usc_MD_rollover_val)
#else
#if defined (IPSC860)
# define usc_clock() usc_MD_clock()
# define usc_rollover_val() (usc_MD_rollover_val)
#else
#if defined(FX2800) || defined(FX2800_SWITCH)
# define usc_clock() usc_MD_clock()
# define usc_rollover_val() (usc_MD_rollover_val)
#else
#if defined(SUN) || defined(DEC5000) || defined(HP) \
|| defined(IBM3090) || defined(RS6000) \
|| defined(NEXT) || defined(TITAN) || defined(GP_1000) \
|| defined(KSR) \
|| defined(SGI) || defined(FX8)
# define usc_clock() usc_MD_clock()
# define usc_rollover_val() (usc_MD_rollover_val * 1000000 - 1)
#else
# define usc_clock() 0
# define usc_rollover_val() 0
#endif
#endif
#endif
#endif
#endif
#endif
#endif
/* ----------------------
function prototypes
---------------------- */
VOID usc_init();
usc_time_t usc_MD_clock();
#endif